using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using iopt.solvency.pillarone.client.desktop.Views;
using Microsoft.VisualBasic;
using System.Collections;
using System.Diagnostics;
using System.Xml.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using System.Runtime.CompilerServices;

namespace iopt.solvency.pillarone.client.desktop.ViewModels
{
    public class ModelEntityDefinition : ModelElementDefinition
    {
    
        public ModelEntityDefinition()
        {
            this.Properties = new ObservableCollection<ModelPropertyDefinition>();
            this.Relations = new ObservableCollection<ModelRelationDefinition>();
        }
        // TODO: Complete member initialization 
        public ModelEntityDefinition(ModelDefinition modelDefinition)
            : base(modelDefinition)
        {
            this.Properties = new ObservableCollection<ModelPropertyDefinition>();
            this.Relations = new ObservableCollection<ModelRelationDefinition>();
           
        }

    
    
        public string Name { get; set; }
        public ModelEntityDefinition Base { get; set; }
        public System.Collections.ObjectModel.ObservableCollection<ModelPropertyDefinition> Properties { get; private set; }
        public System.Collections.ObjectModel.ObservableCollection<ModelRelationDefinition> Relations { get; private set; }
    
        protected internal override System.Xml.Linq.XElement GetXml()
        {
    
            dynamic q = from p in Properties select p.GetXml();
    
            return new XElement("Table", new XAttribute("Name", Name), new XAttribute("Base", Base == null ? null : Base.Name), q);
        }
    }
}
